<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/materialbox/MaterialBox.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/materialbox/MaterialBox.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '料箱数据',
                name: 'materialbox/MaterialBox',
                url: "/MaterialBox/",
                sortName: "MaterialBoxType",
                foreignKey:null
            });
            const editFormFields = ref({"BoxNo":"","RFIDIdentifying":"","MaterialBoxType":"","BoxWeight":"","MaterialName":"","MaterialType":"","BatchNumber":"","HeatNo":"","OrderNumber":"","MRNo":"","MaterialWeight":"","State":"","LocationDescription":"","UpdateTime":"","Enable":"","MaterialId":""});
            const editFormOptions = ref([[{"title":"料箱号","field":"BoxNo"},
                               {"title":"料箱RFID编码（号）","field":"RFIDIdentifying"},
                               {"dataKey":"料箱类型","data":[],"title":"料箱类型","field":"MaterialBoxType","type":"select"}],
                              [{"title":"料箱重量（空箱）","field":"BoxWeight","type":"decimal"},
                               {"dataKey":"物料列表","data":[],"title":"物料名称","field":"MaterialName","type":"select"},
                               {"title":"物料种类（原/合/返)","field":"MaterialType","disabled":true}],
                              [{"title":"批号","field":"BatchNumber"},
                               {"title":"炉号","field":"HeatNo"},
                               {"title":"计划单号","field":"OrderNumber"}],
                              [{"title":"领料单号","field":"MRNo"},
                               {"title":"物料实际重量","field":"MaterialWeight","type":"decimal"},
                               {"dataKey":"库存状态","data":[],"title":"状态","field":"State","type":"select"}],
                              [{"title":"位置描述","field":"LocationDescription"},
                               {"title":"数据更新时间（非人为修改时）","field":"UpdateTime","type":"datetime"},
                               {"dataKey":"enable","data":[],"title":"是否启用","field":"Enable","type":"select"}],
                              [{"title":"物料（产品）ID","field":"MaterialId","disabled":true}]]);
            const searchFormFields = ref({"MaterialBoxType":"","OrderNumber":""});
            const searchFormOptions = ref([[{"dataKey":"料箱类型","data":[],"title":"料箱类型","field":"MaterialBoxType","type":"select"},{"title":"计划单号","field":"OrderNumber"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BoxNo',title:'料箱号',type:'string',link:true,width:110,align:'left',sort:true},
                       {field:'RFIDIdentifying',title:'料箱RFID编码（号）',type:'string',width:110,align:'left'},
                       {field:'MaterialBoxType',title:'料箱类型',type:'string',bind:{ key:'料箱类型',data:[]},sort:true,width:110,align:'left'},
                       {field:'BoxWeight',title:'料箱重量（空箱）',type:'decimal',width:110,align:'left'},
                       {field:'MaterialName',title:'物料名称',type:'string',bind:{ key:'物料列表',data:[]},width:110,align:'left'},
                       {field:'MaterialType',title:'物料种类（原/合/返)',type:'string',width:110,readonly:true,align:'left'},
                       {field:'MaterialId',title:'物料（产品）ID',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'BatchNumber',title:'批号',type:'string',width:110,align:'left'},
                       {field:'HeatNo',title:'炉号',type:'string',width:110,align:'left'},
                       {field:'OrderNumber',title:'计划单号',type:'string',width:110,align:'left'},
                       {field:'MRNo',title:'领料单号',type:'string',width:110,align:'left'},
                       {field:'MaterialWeight',title:'物料实际重量',type:'decimal',width:110,align:'left'},
                       {field:'ExternalWarehouseNo',title:'外库单号',type:'string',width:110,align:'left'},
                       {field:'State',title:'状态',type:'int',bind:{ key:'库存状态',data:[]},width:110,align:'left'},
                       {field:'LocationDescription',title:'位置描述',type:'string',width:110,align:'left'},
                       {field:'UpdateTime',title:'数据更新时间（非人为修改时）',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Enable',title:'是否启用',type:'int',bind:{ key:'enable',data:[]},width:110,align:'left'},
                       {field:'CreateUserName',title:'添加人',type:'string',width:110,align:'left'},
                       {field:'CreateUserId',title:'添加人ID',type:'string',width:110,align:'left'},
                       {field:'CreateDate',title:'添加时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyUserName',title:'修改人',type:'string',width:110,align:'left'},
                       {field:'ModifyUserId',title:'修改人ID',type:'string',width:110,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'DeletionFlag',title:'删除标识',type:'int',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
